{% extends "_base.htm" %}
{% block bodycontent %}
	<h1>App Engine Chat</h1>
	{% ifnotequal error None %}
	<p>
		{{ error }}
	</p>
	{% endifnotequal %}
	{% ifequal error None %}
	<p>
	<form method="post" action="/chat">
	<input type="text" name="message" size="60"/>
	<input type="submit" name="Chat"/>	
	</form>
	</p>
	<div id="chatcontent">
		Loading...
	</div>
<script>
function updateMsg() {
	$.ajax({
		url: "/messages",
		cache: false,
		success: function(html){
			$("#chatcontent").html(html);
		}
	});
	setTimeout('updateMsg()', 4000);
}
updateMsg();
</script>
{% endifequal %}
{% endblock %}